package pers.books.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import pers.books.entity.Book;
import pers.books.service.BookService;
import pers.books.util.ResultMessage;

/**
 * 
 * BookController
 *
 * @author 姜治昊
 * @time 2018年4月30日 下午7:25:25
 */
@RestController
@RequestMapping("book")
public class BookController {

	@Autowired
	private BookService bookService;
	
	/**
	 * 根据ID获取图书信息
	 * @param id
	 * @return
	 */
	@RequestMapping(value="getBookById", method=RequestMethod.POST)
	public ResultMessage<Book> getBookById(String id) {
		return bookService.getBookById(id);
	}
	
}
